
//
//  UIBarButtonItem+Extention.swift
//  mySinaBlog
//
//  Created by whtapple on 3/26/16.
//  Copyright © 2016 whtapple. All rights reserved.
//

import UIKit
extension UIBarButtonItem{
    //主页的 buttonItem
    convenience init(imageString: String, target:AnyObject, selector: Selector) {
        let btn = UIButton()
        btn.setBackgroundImage(UIImage(named: imageString), forState: UIControlState.Normal)
          btn.setBackgroundImage(UIImage(named: "\(imageString)_highlighted"), forState: UIControlState.Normal)
        btn.addTarget(target, action: selector, forControlEvents: UIControlEvents.TouchUpInside)
        btn.sizeToFit()
        self.init(customView: btn)
    
    }
    
    
}